3.307 \(\int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{(a+b \tan (c+d x))^2} \, dx\)

Optimal. Leaf size=83 \[ \frac {a B \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac {b B x}{a^2+b^2}-\frac {a^3 B \log (a+b \tan (c+d x))}{b^2 d \left (a^2+b^2\right )}+\frac {B \tan (c+d x)}{b d} \]

[Out]

-b*B*x/(a^2+b^2)+a*B*ln(cos(d*x+c))/(a^2+b^2)/d-a^3*B*ln(a+b*tan(d*x+c))/b^2/(a^2+b^2)/d+B*tan(d*x+c)/b/d

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {21, 3566, 3626, 3617, 31, 3475} \[ -\frac {a^3 B \log (a+b \tan (c+d x))}{b^2 d \left (a^2+b^2\right )}+\frac {a B \log (\cos (c+d x))}{d \left (a^2+b^2\right )}-\frac {b B x}{a^2+b^2}+\frac {B \tan (c+d x)}{b d} \]

Antiderivative was successfully verified.

[In]

Int[(Tan[c + d*x]^3*(a*B + b*B*Tan[c + d*x]))/(a + b*Tan[c + d*x])^2,x]

[Out]

-((b*B*x)/(a^2 + b^2)) + (a*B*Log[Cos[c + d*x]])/((a^2 + b^2)*d) - (a^3*B*Log[a + b*Tan[c + d*x]])/(b^2*(a^2 +
 b^2)*d) + (B*Tan[c + d*x])/(b*d)

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3566

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Si
mp[(b^2*(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^(n + 1))/(d*f*(m + n - 1)), x] + Dist[1/(d*(m + n -
1)), Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n - 1) - b^2*(b*c*(m - 2) + a*d*(
1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2,
 x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
&& IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || IntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0]
&& NeQ[a, 0])))

Rule 3617

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]

Rule 3626

Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[((a*A + b*B - a*C)*x)/(a^2 + b^2), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]

Rubi steps

\begin {align*} \int \frac {\tan ^3(c+d x) (a B+b B \tan (c+d x))}{(a+b \tan (c+d x))^2} \, dx &=B \int \frac {\tan ^3(c+d x)}{a+b \tan (c+d x)} \, dx\\ &=\frac {B \tan (c+d x)}{b d}+\frac {B \int \frac {-a-b \tan (c+d x)-a \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b}\\ &=-\frac {b B x}{a^2+b^2}+\frac {B \tan (c+d x)}{b d}-\frac {(a B) \int \tan (c+d x) \, dx}{a^2+b^2}-\frac {\left (a^3 B\right ) \int \frac {1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b \left (a^2+b^2\right )}\\ &=-\frac {b B x}{a^2+b^2}+\frac {a B \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}+\frac {B \tan (c+d x)}{b d}-\frac {\left (a^3 B\right ) \operatorname {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^2 \left (a^2+b^2\right ) d}\\ &=-\frac {b B x}{a^2+b^2}+\frac {a B \log (\cos (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a^3 B \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {B \tan (c+d x)}{b d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.42, size = 92, normalized size = 1.11 \[ -\frac {B \left (\frac {2 a^3 \log (a+b \tan (c+d x))}{b^2 \left (a^2+b^2\right )}+\frac {\log (-\tan (c+d x)+i)}{a+i b}+\frac {\log (\tan (c+d x)+i)}{a-i b}-\frac {2 \tan (c+d x)}{b}\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(Tan[c + d*x]^3*(a*B + b*B*Tan[c + d*x]))/(a + b*Tan[c + d*x])^2,x]

[Out]

-1/2*(B*(Log[I - Tan[c + d*x]]/(a + I*b) + Log[I + Tan[c + d*x]]/(a - I*b) + (2*a^3*Log[a + b*Tan[c + d*x]])/(
b^2*(a^2 + b^2)) - (2*Tan[c + d*x])/b))/d

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 119, normalized size = 1.43 \[ -\frac {2 \, B b^{3} d x + B a^{3} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - {\left (B a^{3} + B a b^{2}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) - 2 \, {\left (B a^{2} b + B b^{3}\right )} \tan \left (d x + c\right )}{2 \, {\left (a^{2} b^{2} + b^{4}\right )} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3*(a*B+b*B*tan(d*x+c))/(a+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/2*(2*B*b^3*d*x + B*a^3*log((b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1)) - (B*a^3 +
 B*a*b^2)*log(1/(tan(d*x + c)^2 + 1)) - 2*(B*a^2*b + B*b^3)*tan(d*x + c))/((a^2*b^2 + b^4)*d)

________________________________________________________________________________________

giac [A]  time = 0.88, size = 90, normalized size = 1.08 \[ -\frac {\frac {2 \, B a^{3} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (d x + c\right )} B b}{a^{2} + b^{2}} + \frac {B a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, B \tan \left (d x + c\right )}{b}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3*(a*B+b*B*tan(d*x+c))/(a+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

-1/2*(2*B*a^3*log(abs(b*tan(d*x + c) + a))/(a^2*b^2 + b^4) + 2*(d*x + c)*B*b/(a^2 + b^2) + B*a*log(tan(d*x + c
)^2 + 1)/(a^2 + b^2) - 2*B*tan(d*x + c)/b)/d

________________________________________________________________________________________

maple [A]  time = 0.24, size = 98, normalized size = 1.18 \[ \frac {B \tan \left (d x +c \right )}{b d}-\frac {a^{3} B \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{2} \left (a^{2}+b^{2}\right ) d}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a B}{2 d \left (a^{2}+b^{2}\right )}-\frac {B \arctan \left (\tan \left (d x +c \right )\right ) b}{d \left (a^{2}+b^{2}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3*(a*B+b*B*tan(d*x+c))/(a+b*tan(d*x+c))^2,x)

[Out]

B*tan(d*x+c)/b/d-a^3*B*ln(a+b*tan(d*x+c))/b^2/(a^2+b^2)/d-1/2/d/(a^2+b^2)*ln(1+tan(d*x+c)^2)*a*B-1/d/(a^2+b^2)
*B*arctan(tan(d*x+c))*b

________________________________________________________________________________________

maxima [A]  time = 0.57, size = 89, normalized size = 1.07 \[ -\frac {\frac {2 \, B a^{3} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{2} b^{2} + b^{4}} + \frac {2 \, {\left (d x + c\right )} B b}{a^{2} + b^{2}} + \frac {B a \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} - \frac {2 \, B \tan \left (d x + c\right )}{b}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3*(a*B+b*B*tan(d*x+c))/(a+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/2*(2*B*a^3*log(b*tan(d*x + c) + a)/(a^2*b^2 + b^4) + 2*(d*x + c)*B*b/(a^2 + b^2) + B*a*log(tan(d*x + c)^2 +
 1)/(a^2 + b^2) - 2*B*tan(d*x + c)/b)/d

________________________________________________________________________________________

mupad [B]  time = 6.37, size = 98, normalized size = 1.18 \[ \frac {B\,\mathrm {tan}\left (c+d\,x\right )}{b\,d}-\frac {B\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{2\,d\,\left (a-b\,1{}\mathrm {i}\right )}-\frac {B\,a^3\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{b^2\,d\,\left (a^2+b^2\right )}-\frac {B\,\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d\,\left (-b+a\,1{}\mathrm {i}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((tan(c + d*x)^3*(B*a + B*b*tan(c + d*x)))/(a + b*tan(c + d*x))^2,x)

[Out]

(B*tan(c + d*x))/(b*d) - (B*log(tan(c + d*x) + 1i))/(2*d*(a - b*1i)) - (B*log(tan(c + d*x) - 1i)*1i)/(2*d*(a*1
i - b)) - (B*a^3*log(a + b*tan(c + d*x)))/(b^2*d*(a^2 + b^2))

________________________________________________________________________________________

sympy [A]  time = 2.14, size = 660, normalized size = 7.95 \[ \begin {cases} \tilde {\infty } B x \tan ^{2}{\relax (c )} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\- \frac {3 B d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {3 i B d x}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {i B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )} \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {2 B \tan ^{2}{\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {2 i B \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} - 2 i b d} + \frac {5 B}{2 b d \tan {\left (c + d x \right )} - 2 i b d} & \text {for}\: a = - i b \\- \frac {3 B d x \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {3 i B d x}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {i B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )} \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {B \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {2 B \tan ^{2}{\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} - \frac {2 i B \tan {\left (c + d x \right )}}{2 b d \tan {\left (c + d x \right )} + 2 i b d} + \frac {5 B}{2 b d \tan {\left (c + d x \right )} + 2 i b d} & \text {for}\: a = i b \\\frac {B \left (- \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {\tan ^{2}{\left (c + d x \right )}}{2 d}\right )}{a} & \text {for}\: b = 0 \\\frac {x \left (B a + B b \tan {\relax (c )}\right ) \tan ^{3}{\relax (c )}}{\left (a + b \tan {\relax (c )}\right )^{2}} & \text {for}\: d = 0 \\- \frac {2 B a^{3} \log {\left (\frac {a}{b} + \tan {\left (c + d x \right )} \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} + \frac {2 B a^{2} b \tan {\left (c + d x \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} - \frac {B a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} - \frac {2 B b^{3} d x}{2 a^{2} b^{2} d + 2 b^{4} d} + \frac {2 B b^{3} \tan {\left (c + d x \right )}}{2 a^{2} b^{2} d + 2 b^{4} d} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3*(a*B+b*B*tan(d*x+c))/(a+b*tan(d*x+c))**2,x)

[Out]

Piecewise((zoo*B*x*tan(c)**2, Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (-3*B*d*x*tan(c + d*x)/(2*b*d*tan(c + d*x) - 2*
I*b*d) + 3*I*B*d*x/(2*b*d*tan(c + d*x) - 2*I*b*d) + I*B*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(2*b*d*tan(c + d
*x) - 2*I*b*d) + B*log(tan(c + d*x)**2 + 1)/(2*b*d*tan(c + d*x) - 2*I*b*d) + 2*B*tan(c + d*x)**2/(2*b*d*tan(c
+ d*x) - 2*I*b*d) + 2*I*B*tan(c + d*x)/(2*b*d*tan(c + d*x) - 2*I*b*d) + 5*B/(2*b*d*tan(c + d*x) - 2*I*b*d), Eq
(a, -I*b)), (-3*B*d*x*tan(c + d*x)/(2*b*d*tan(c + d*x) + 2*I*b*d) - 3*I*B*d*x/(2*b*d*tan(c + d*x) + 2*I*b*d) -
 I*B*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(2*b*d*tan(c + d*x) + 2*I*b*d) + B*log(tan(c + d*x)**2 + 1)/(2*b*d*
tan(c + d*x) + 2*I*b*d) + 2*B*tan(c + d*x)**2/(2*b*d*tan(c + d*x) + 2*I*b*d) - 2*I*B*tan(c + d*x)/(2*b*d*tan(c
 + d*x) + 2*I*b*d) + 5*B/(2*b*d*tan(c + d*x) + 2*I*b*d), Eq(a, I*b)), (B*(-log(tan(c + d*x)**2 + 1)/(2*d) + ta
n(c + d*x)**2/(2*d))/a, Eq(b, 0)), (x*(B*a + B*b*tan(c))*tan(c)**3/(a + b*tan(c))**2, Eq(d, 0)), (-2*B*a**3*lo
g(a/b + tan(c + d*x))/(2*a**2*b**2*d + 2*b**4*d) + 2*B*a**2*b*tan(c + d*x)/(2*a**2*b**2*d + 2*b**4*d) - B*a*b*
*2*log(tan(c + d*x)**2 + 1)/(2*a**2*b**2*d + 2*b**4*d) - 2*B*b**3*d*x/(2*a**2*b**2*d + 2*b**4*d) + 2*B*b**3*ta
n(c + d*x)/(2*a**2*b**2*d + 2*b**4*d), True))

________________________________________________________________________________________